package com.ruoyi.common.domainenum;



import com.baomidou.mybatisplus.annotation.EnumValue;
import com.ruoyi.common.enumsupport.IBaseEnum;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 */
public enum FinSubjectMoneyType implements IBaseEnum<String> {

    MONEY("1", "现金"),
    BANK("2", "银行"),
    MONEY_EQUAL("3", "现金等价物"),
    NOT_MONEY("0", "非现金科目"),
    ;
    @EnumValue
    private final String value;
    private final String description;

    FinSubjectMoneyType(String value, String description) {
        this.value = value;
        this.description = description;

    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public List<Map<String, String>> buildEnumMap() {
        List<Map<String, String>> result = new ArrayList<>();
        for (FinSubjectMoneyType valueType : FinSubjectMoneyType.values()) {
            Map<String, String> map = new HashMap<>();
            map.put("name", valueType.getDescription());
            map.put("code", valueType.toString());
            result.add(map);
        }
        return result;
    }

}
